﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SignIn1.aspx.cs" Inherits="GroundWater.SignIn1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
    <style type="text/css">
		td { FONT-SIZE: 12px }
		.TableControl { BACKGROUND: #eff7ff }
	</style>
	<script src="js/jquery.js" type="text/javascript" ></script>
</head>
<body>
    <form id="form1" runat="server"><asp:ScriptManager ID="scriptManager" runat="server" />
    <div id="pnlMain">
	<br />
	<br />
	<table cellSpacing="0" cellPadding="0" align="center" border="0">
		<tr>
			<td colSpan="2"><img height="18" alt="" src="images/login-ii_r1_c1.jpg" width="676" border="0" name="loginii_r1_c1"></td>
			<td rowSpan="3"><img height="439" alt="" src="images/login-ii_r1_c8.jpg" width="14" border="0" name="loginii_r1_c8"></td>
		</tr>
		<tr>
			<td width="13" rowSpan="2"><img height="421" alt="" src="images/login-ii_r2_c1.jpg" width="13" border="0" name="loginii_r2_c1"></td>
			<td><img height="272" alt="" src="images/login-ii_r2_c2_.jpg" width="663" border="0" name="loginii_r2_c2"></td>
		</tr>
		<tr>
			<td vAlign="middle" align="center" background="images/login-ii_r3_c100.jpg" height="149">
				<table width="100%" border="0">
					<tr>
						
                        <td align="right" width="200">
                        <img src="images/mylogo.gif" />
                         </td>
						<td>
						
						<%--
							<table cellSpacing="0" cellPadding="0" align="center" border="0">
								<tr>
									<td align="right"><img height="68" src="images/login-ii_r4_c4.jpg" width="78"></td>
									<td align="left" colSpan="2">

						<table cellSpacing="0" cellPadding="0" width="246" align="center" border="0">
                        <TR align="center"> 
                          <td colspan="3"><SPAN style="COLOR: #ff0000"> </SPAN></td>
                        </tr>
                        <tr> 
                          <td height="18">用户名：</td>
                          <td colSpan="2"><input name="txtUserId" type="text" id="txtUserId" style="width:120px" maxlength="20" size="16" value="admin" /></td>
                        </tr>
                        <tr> 
                          <td height="18">密&nbsp;&nbsp;码：</td>
                          <td><input name="txtPassword" type="password" id="txtPassword" style="width:120px" maxlength="20" size="16" /></td>
                          <td><INPUT onclick="return CheckForm()" type="image" height="23" width="59" src="images/login-ii_r5_c6.gif"border="0" name="imageField"></td>
                        </tr>
                        <tr> 
                          <td height="18">企业用户：</td>
                          <td><input name="chkExternal" type="checkbox" id="txtExternal" /></td>
                          <td></td>
                        </tr>
                        
                      </table>
                      
									</td>
								</tr>
							</table>
							--%>
							
							<asp:Login ID="Login1" runat="server">
                          <LayoutTemplate>
                              <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" align="center">
                                  <tr>
                                      <td align="right"><img height="68" src="images/login-ii_r4_c4.jpg" width="78"></td>
                                      <td align="left" colspan="2">
                                          <table border="0" cellpadding="0" width="246" align="center">
                                            <tr align="center"> 
                                              <td colspan="3"><span style="COLOR: #ff0000"> </span></td>
                                            </tr>
                                              <tr>
                                                  <td align="right"><asp:Label ID="UserNameLabel" runat="server" AssociatedControlID="Username">用户名：</asp:Label></td>
                                                  <td colspan="2">
                                                      <asp:TextBox ID="Username" runat="server" Width="145px"></asp:TextBox>
                                                      <asp:RequiredFieldValidator ID="UserNameRequired" runat="server" ControlToValidate="Username"
                                                          ErrorMessage="User Name is required." ToolTip="User Name is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                                  </td>
                                              </tr>
                                              <tr>
                                                  <td align="right">
                                                      <asp:Label ID="PasswordLabel" runat="server" AssociatedControlID="Password">密码：</asp:Label></td>
                                                  <td colspan="2">
                                                      <asp:TextBox ID="Password" runat="server" TextMode="Password" Width="145px"></asp:TextBox>
                                                      <asp:RequiredFieldValidator ID="PasswordRequired" runat="server" ControlToValidate="Password"
                                                          ErrorMessage="Password is required." ToolTip="Password is required." ValidationGroup="Login1">*</asp:RequiredFieldValidator>
                                                  </td>
                                              </tr>
                                              <%--<tr>
                                                  <td></td>
                                                  <td colspan="2"><asp:CheckBox ID="CheckBox1" runat="server" Text="是企业用户" /></td>
                                              </tr>--%>
                                              <tr>
                                              <td></td>
                                                  <%--<td colspan="2">
                                                      <asp:CheckBox ID="RememberMe" runat="server" Text="记住我" />&nbsp;&nbsp;&nbsp;<span style="color: red"><asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal></span>
                                                  </td>--%>
                                              </tr>
                                              <%--<tr>
                                                  <td align="center" colspan="3" style="color: red">
                                                      
                                                  </td>
                                              </tr>--%>
                                              <tr>
                                                  <td align="right" colspan="3">
                                                      <asp:ImageButton ID="btnOK" runat="server" ImageUrl="~/images/login-ii_r5_c6.jpg" height="29" width="65" border="0" CommandName="Login" ValidationGroup="Login1" />
                                                  <%--<INPUT onclick="return CheckForm()" type="image" height="23" width="59" src="images/login-ii_r5_c6.gif" border="0" name="imageField">
                                                      <asp:Button ID="LoginButton" runat="server" CommandName="Login" Text="Log In" ValidationGroup="Login1" />--%>
                                                  </td>
                                              </tr>
                                          </table>
                                      </td>
                                  </tr>
                              </table>
                          </LayoutTemplate>
                      </asp:Login>
						</td>
					</tr>
				</table>
        </td>
		</tr>
		<tr>
			<td colSpan="3"><img title="用户登陆" height="30" alt="用户登陆" src="images/login-ii_r8_c1.jpg" width="690" border="0">
			</td>
		</tr>
	</table>
    
<center><a href="http://www.hgzp.com.cn" target="_blank" style="font-size:12px;text-decoration: none;"><font color="black">青鸟华光科技,版权所有</font> <font color="blue"> www.hgzp.com.cn</font></a></center>
</div>

    </form>
    <script type="text/javascript">
//<![CDATA[
    jQuery(document).ready(function() {

        //document.getElementById("txtUsername").focus();
    document.getElementById("Login1_btnOK").onclick = submitForm;

        jQuery("#updateProgress").ajaxStart(function() {
            jQuery("#updateProgress").show();
        }).ajaxStop(function() {
            jQuery(this).hide();
        }).ajaxError(function(event, request, settings) {
            alert("出现了错误！没有链接到数据库。");
        });

    });

    function submitForm() {

        var username = $("#txtUsername").val();
        var password = $("#txtPassword").val();
        if (username == null || username.length == 0) {
            alert("用户帐号必须填写！");
            return false;
        }
        if (password == null || password.length == 0) {
            alert("密码必须填写！");

            return false;
        }
        $.post(
                    "AllowAccess/LoginHandler.ashx",
                    { "username": username, "password": password },
                    function(data) {
                        var response = data;
                        //alert(data);
                        //window.location = 'Default.aspx';
                        if (data && data != "0") {
                            window.location = 'Default.aspx';
                        }
                        else {

                            alert("用户帐号或密码不正确。");

                        }
                    },
                    "text");
                }
    
    function pageLoad(sender, args) {
        $get("Login1_UserName").focus();
    }

    $addHandler($get("Login1_UserName"), "keydown", tabHandler);
    $addHandler($get("Login1_Password"), "keydown", submitHandler);

    function tabHandler(e) {
        if (e.keyCode == Sys.UI.Key.enter) {
            $get('txtPossword').focus();
        }
    }

    function submitHandler(e) {
        if (e.keyCode == Sys.UI.Key.enter) {
            submitForm();
        }
    }
//]]>
</script>
    
</body>
</html>
